package hjw.com.dao;

import hjw.com.entity.OrderItem;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>Project:Academic - OrderItemMapper
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/2/18 13:05
 * @since 1.8
 */
@Mapper
public interface OrderItemMapper {
    /**
     * 根据订单id查找订单项明细
     * @param orderId orderId
     * @return List
     */
    List<OrderItem> findByOrderId(int orderId);
    /**
     * 根据订单明细id查找商品
     * @param itemId itemId
     * @return List
     */
    OrderItem findByItemId(int itemId);

    /**
     * 添加订单项
     * @param orderItem orderItem
     * @return int
     */
    int addOrderItem(OrderItem orderItem);

    /**
     * 删除订单项
     * @param orderItem orderItem
     * @return int
     */
    int deleteOrderItem(OrderItem orderItem);
}
